{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "7127360a",
   "metadata": {},
   "source": [
    "#### 1.课本代码（项目一，从奇数中选择对应的时间节点）"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "d80bf2e7",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "hello world\n"
     ]
    }
   ],
   "source": [
    "print (\"hello world\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "93a6bf82",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "datetime.datetime(2021, 9, 12, 14, 15, 59, 389596)"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from datetime import datetime\n",
    "datetime.today()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "ec1f727a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "datetime.date(2021, 9, 12)"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import datetime\n",
    "datetime.date.today()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "512b9ae7",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Not an odd minute.\n"
     ]
    }
   ],
   "source": [
    "# 课本代码（项目一，从奇数中选择对应的时间节点）\n",
    "from datetime import datetime\n",
    "\n",
    "odds = [1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59]\n",
    "\n",
    "right_this_minute = datetime.today().minute\n",
    "\n",
    "if right_this_minute in odds:\n",
    "    print(\"时间是奇数，时间在odds的数据中\")\n",
    "else:\n",
    "    print(\"Not an odd minute.\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "caa28090",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Not an odd minute.\n"
     ]
    }
   ],
   "source": [
    "# 课本代码（项目一，从奇数中选择对应的时间节点）\n",
    "from datetime import datetime\n",
    "\n",
    "odds = [1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59]\n",
    "\n",
    "right_this_minute = datetime.today().minute\n",
    "\n",
    "if right_this_minute in odds:\n",
    "    print(\"时间是奇数，时间在odds的数据中\")\n",
    "else:\n",
    "    print(\"Not an odd minute.\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "e8b65ef7",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "c4ab8557",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "id": "7cc4d418",
   "metadata": {},
   "source": [
    "## 变量（数字 对象 字符串）"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "2f9124a2",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "5"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    ">>> 2 + 3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "2277280e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "4.0"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    ">>> (50-5*6)/5"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "932a68c1",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "751c5c9c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "\"doesn't\""
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "\"doesn't\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "d167e796",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "\"doesnt't\""
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "'doesnt\\'t'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "4643086b",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "id": "7d223eac",
   "metadata": {},
   "source": [
    "# python 里所有的都是对象"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "33eb271c",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "96acd26a",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "fe1a6477",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "9f288ea7",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "id": "99863f29",
   "metadata": {},
   "source": [
    "## if else 笔记\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "6b9e1445",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "hello world\n",
      "99 瓶 雪花 在啤酒柜上\n",
      "99 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "98 瓶 雪花 在啤酒柜上\n",
      "98 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "97 瓶 雪花 在啤酒柜上\n",
      "97 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "96 瓶 雪花 在啤酒柜上\n",
      "96 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "95 瓶 雪花 在啤酒柜上\n",
      "95 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "94 瓶 雪花 在啤酒柜上\n",
      "94 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "93 瓶 雪花 在啤酒柜上\n",
      "93 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "92 瓶 雪花 在啤酒柜上\n",
      "92 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "91 瓶 雪花 在啤酒柜上\n",
      "91 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "90 瓶 雪花 在啤酒柜上\n",
      "90 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "89 瓶 雪花 在啤酒柜上\n",
      "89 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "88 瓶 雪花 在啤酒柜上\n",
      "88 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "87 瓶 雪花 在啤酒柜上\n",
      "87 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "86 瓶 雪花 在啤酒柜上\n",
      "86 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "85 瓶 雪花 在啤酒柜上\n",
      "85 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "84 瓶 雪花 在啤酒柜上\n",
      "84 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "83 瓶 雪花 在啤酒柜上\n",
      "83 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "82 瓶 雪花 在啤酒柜上\n",
      "82 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "81 瓶 雪花 在啤酒柜上\n",
      "81 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "80 瓶 雪花 在啤酒柜上\n",
      "80 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "79 瓶 雪花 在啤酒柜上\n",
      "79 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "78 瓶 雪花 在啤酒柜上\n",
      "78 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "77 瓶 雪花 在啤酒柜上\n",
      "77 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "76 瓶 雪花 在啤酒柜上\n",
      "76 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "75 瓶 雪花 在啤酒柜上\n",
      "75 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "74 瓶 雪花 在啤酒柜上\n",
      "74 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "73 瓶 雪花 在啤酒柜上\n",
      "73 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "72 瓶 雪花 在啤酒柜上\n",
      "72 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "71 瓶 雪花 在啤酒柜上\n",
      "71 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "70 瓶 雪花 在啤酒柜上\n",
      "70 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "69 瓶 雪花 在啤酒柜上\n",
      "69 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "68 瓶 雪花 在啤酒柜上\n",
      "68 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "67 瓶 雪花 在啤酒柜上\n",
      "67 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "66 瓶 雪花 在啤酒柜上\n",
      "66 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "65 瓶 雪花 在啤酒柜上\n",
      "65 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "64 瓶 雪花 在啤酒柜上\n",
      "64 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "63 瓶 雪花 在啤酒柜上\n",
      "63 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "62 瓶 雪花 在啤酒柜上\n",
      "62 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "61 瓶 雪花 在啤酒柜上\n",
      "61 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "60 瓶 雪花 在啤酒柜上\n",
      "60 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "59 瓶 雪花 在啤酒柜上\n",
      "59 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "58 瓶 雪花 在啤酒柜上\n",
      "58 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "57 瓶 雪花 在啤酒柜上\n",
      "57 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "56 瓶 雪花 在啤酒柜上\n",
      "56 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "55 瓶 雪花 在啤酒柜上\n",
      "55 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "54 瓶 雪花 在啤酒柜上\n",
      "54 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "53 瓶 雪花 在啤酒柜上\n",
      "53 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "52 瓶 雪花 在啤酒柜上\n",
      "52 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "51 瓶 雪花 在啤酒柜上\n",
      "51 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "50 瓶 雪花 在啤酒柜上\n",
      "50 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "49 瓶 雪花 在啤酒柜上\n",
      "49 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "48 瓶 雪花 在啤酒柜上\n",
      "48 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "47 瓶 雪花 在啤酒柜上\n",
      "47 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "46 瓶 雪花 在啤酒柜上\n",
      "46 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "45 瓶 雪花 在啤酒柜上\n",
      "45 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "44 瓶 雪花 在啤酒柜上\n",
      "44 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "43 瓶 雪花 在啤酒柜上\n",
      "43 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "42 瓶 雪花 在啤酒柜上\n",
      "42 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "41 瓶 雪花 在啤酒柜上\n",
      "41 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "40 瓶 雪花 在啤酒柜上\n",
      "40 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "39 瓶 雪花 在啤酒柜上\n",
      "39 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "38 瓶 雪花 在啤酒柜上\n",
      "38 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "37 瓶 雪花 在啤酒柜上\n",
      "37 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "36 瓶 雪花 在啤酒柜上\n",
      "36 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "35 瓶 雪花 在啤酒柜上\n",
      "35 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "34 瓶 雪花 在啤酒柜上\n",
      "34 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "33 瓶 雪花 在啤酒柜上\n",
      "33 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "32 瓶 雪花 在啤酒柜上\n",
      "32 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "31 瓶 雪花 在啤酒柜上\n",
      "31 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "30 瓶 雪花 在啤酒柜上\n",
      "30 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "29 瓶 雪花 在啤酒柜上\n",
      "29 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "28 瓶 雪花 在啤酒柜上\n",
      "28 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "27 瓶 雪花 在啤酒柜上\n",
      "27 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "26 瓶 雪花 在啤酒柜上\n",
      "26 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "25 瓶 雪花 在啤酒柜上\n",
      "25 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "24 瓶 雪花 在啤酒柜上\n",
      "24 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "23 瓶 雪花 在啤酒柜上\n",
      "23 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "22 瓶 雪花 在啤酒柜上\n",
      "22 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "21 瓶 雪花 在啤酒柜上\n",
      "21 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "20 瓶 雪花 在啤酒柜上\n",
      "20 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "19 瓶 雪花 在啤酒柜上\n",
      "19 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "18 瓶 雪花 在啤酒柜上\n",
      "18 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "17 瓶 雪花 在啤酒柜上\n",
      "17 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "16 瓶 雪花 在啤酒柜上\n",
      "16 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "15 瓶 雪花 在啤酒柜上\n",
      "15 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "14 瓶 雪花 在啤酒柜上\n",
      "14 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "13 瓶 雪花 在啤酒柜上\n",
      "13 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "12 瓶 雪花 在啤酒柜上\n",
      "12 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "11 瓶 雪花 在啤酒柜上\n",
      "11 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "10 瓶 雪花 在啤酒柜上\n",
      "10 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "9 瓶 雪花 在啤酒柜上\n",
      "9 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "8 瓶 雪花 在啤酒柜上\n",
      "8 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "7 瓶 雪花 在啤酒柜上\n",
      "7 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "6 瓶 雪花 在啤酒柜上\n",
      "6 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "5 瓶 雪花 在啤酒柜上\n",
      "5 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "4 瓶 雪花 在啤酒柜上\n",
      "4 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "3 瓶 雪花 在啤酒柜上\n",
      "3 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "2 瓶 雪花 在啤酒柜上\n",
      "2 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "2 瓶 雪花 在啤酒柜上\n",
      "1 瓶 雪花 在啤酒柜上\n",
      "1 雪花 :瓶\n",
      "Take one down\n",
      "Pass it around\n",
      "没有更多的雪花啤酒了\n"
     ]
    }
   ],
   "source": [
    "print (\"hello world\")\n",
    "\n",
    "word = \"雪花\"\n",
    "for beer_num in range(99,0,-1):\n",
    "    # 吧台讲\n",
    "    print(beer_num,\"瓶\",word,\"在啤酒柜上\")\n",
    "    print(beer_num,word,\":瓶\")\n",
    "    print(\"Take one down\")\n",
    "    print(\"Pass it around\")\n",
    "    # 客户\n",
    "    if beer_num == 1:\n",
    "        print(\"没有更多的雪花啤酒了\")\n",
    "    else:\n",
    "        # 因为数值是可以运算的\n",
    "        new_num = beer_num -1\n",
    "        if new_num == 1:\n",
    "            word = \"雪花\"\n",
    "            print(beer_num,\"瓶\",word,\"在啤酒柜上\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "6d354e46",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "92c20538",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "e1a297d5",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {
    "height": "calc(100% - 180px)",
    "left": "10px",
    "top": "150px",
    "width": "165px"
   },
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
